Skip to main content

All Questions

1vote
2answers
2kviews

Replace a command with the result (command output) in the line using sed

Is it possible to replace a command extracted by some regex with its output using sed? For example, I have the next file: 2 + 2 = $$shell:echo 2 + 2 | bc$$ // and "some unescaped text' here how I ...
Cyrill's user avatar
2votes
2answers
310views

deleting characters from expression using sed

I have a string in the form |a Some text, letters or numbers. | Some other text letters or numbers |b some other part of text |c some other letters or numbers notice the bar can be on its own, as ...
Michael Riordan's user avatar
1vote
1answer
285views

What are the commands that you can use in the beginning of a sed command?

I initially learned to do sed search and replace like so: sed -e 's/<stuff>/<replacement>/' However I recently learned that these will do something different based on what command ...
Cory Klein's user avatar
2votes
1answer
313views

Delete repeated words between brackets inline

Our input looks something like 2012-04-17 [GBPGBP] 2012-04-13 [GBP GBP] 2012-04-13 [GBP] 2012-04-11 [GBPGBP] 2012-04-11 [GBP GBP] 2012-04-10 [GBPGBP] 2012-04-06 [GBP GBP GBP] 2012-04-17 [...
Chris's user avatar
4votes
1answer
1kviews

Construct my own character classes

I want to construct my own character class in a script, then modify (and use) it, for example: [:myclass:] contains a, *, \n (as linefeed) and [WHITESPACE]. I want to add all characters to [:myclass:] ...
vakufo's user avatar

close